package com.lanhao.aot.reflect;

import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Supplier;

public class FunctionCoding {
	public static void main(String[] args) {
		Supplier<String> getRandomHash = new Supplier<String>() {
			@Override
			public String get() {
				return "Hello World!";
			}
		};

		String string = getRandomHash.get();
		System.out.println(string);

		BiFunction<String, String, String> function = new BiFunction<String, String, String>() {
			@Override
			public String apply(String t, String u) {
				return t.concat(u);
			}
		};
		
		System.out.println(function.apply("Hello + ", "World"));
		
		
		Consumer<String> s = new Consumer<String>() {
			@Override
			public void accept(String t) {
				System.out.println(t);
			}
		};
		
		s.accept("Hello World!!");
	}

}
